# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Maxim Andersson <thesilentboatman@gmail.com>
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de>

pkgdesc="A module with some convenient utilities not included with the standard Python install"
pkgname=python-utils
pkgver=3.5.2
pkgrel=2
arch=(any)
url="https://github.com/WoLpH/python-utils"
license=(BSD)
depends=(python)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-loguru python-pytest-runner)
optdepends=('python-loguru: for logging support')
source=(https://pypi.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz{,.asc})
sha512sums=('2e36bbb2e43591744c63ea972b7f361138694eb32510643ea88e8d757882379e3aec247c2fc4d5c67876939b71d564570a975700728c79f9db0cc4fcbc1605e7'
            'SKIP')
b2sums=('9532d8fecd8d57a9a9f50e2e7e67386e4c5922f4ec316851544147f6da82586bb01796bb3e3fc95c894a790c57711c983d8da9abc5edc5a722089a0d86d7fb61'
        'SKIP')
validpgpkeys=('149325FD15904E9C4EB89E95E81444E9CE1F695D') # Rick van Hattem <wolph@wol.ph>

build() {
  cd $pkgname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $pkgname-$pkgver
  pytest -vv -c /dev/null
}

package() {
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
